body {
  background: url(../images/b1.jpg);
  background-repeat: no-repeat;
  background-position: 50%;
}

// 最外层容器
.contian {
  width: 312px;
  position: relative;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;

  // 游戏主页
  .home_page {
    z-index: 99999;
    position: absolute;
    top: 0;
    left: 0;

    .bgHome {
      width: 312px;
      height: 487px;
      > img {
        width: 100%;
        height: 100%;
      }
    }

    // 页面汽车的动画添加
    .car{
      display: block;
      width: 350px;
      height: 75px;
      background: url("../images/car.png");
      background-repeat: no-repeat;
      background-size: 78%;
      background-position-y: 0px;
      position: fixed;
      top: 230px;
      left: 58px;
      animation: run 0.5s step-end infinite;
    }
    @keyframes run {
      0%,100%{
        background-position-y: 0;
      }
      25%{
        background-position-y: -73px;
      }
      50%{
        background-position-y: -146px;
      }
      75%{
        background-position-y: -219px;
      }
    }
    .carHid{
      display: none;
    }

    .gameBtn1{
        margin: -166px 0 0 105px;
        >img{
            width: 108px;
        }
    }

    .gameBtn2{
        margin-left: 105px;
        >img{
            width: 108px;
        }
    }
  }
  // 控制页面的出现或隐藏时用到
  .moveShow3{
    left: -312px;
  }

  // 游戏进行页
  .fade {
    width: 100%;
    background: #d69713;
    position: absolute;
    left: -312px;
    z-index: -999;
    opacity: 0.8;

    .count {
      padding: 18px 0 0 18px;

      p {
        line-height: 30px;
      }
      p:nth-of-type(1) {
        font-size: 22px;
        color: white;
      }
      p:nth-of-type(2) {
        font-size: 36px;
        font-weight: bold;
        padding-left: 55px;
        margin-bottom: -15px;
      }
    }

    .play {
      width: 290px;
      height: 360px;
      margin: 0 auto;
      padding: 32px 0;
      display: flex;
      flex-direction: column;
      justify-content: space-between;

      .row {
        display: flex;
        justify-content: space-around;

        .card {
          width: 66px;
          height: 66px;
          line-height: 66px;
          text-align: center;
          margin: 0px auto;
          transition: all 0.3s;
          position: relative;
          /*父类容器中 perspective 子类允许透视*/
          perspective: 1000px;
          /*使其子类变换后得以保留 3d转换后的位置*/
          transform-style: preserve-3d;

          .front,
          .back {
            width: 100%;
            height: 100%;
            border-radius: 5px;
            /*背景不穿透，表示翻转后便看不到正面*/
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
            transition: all 0.3s;
            position: absolute;
            top: 0;
            left: 0;
          }

          .front {
            background-color: #f3e085;
            transform: rotateY(0deg);
          }

          .back {
            background-color: white;
            transform: rotateY(180deg);

            img {
              width: 100%;
              height: 100%;
              border-radius: 5px;
            }
          }
        }

        /*鼠标移动覆盖时，触发翻转*/
        .backClick {
          transform: rotateY(0deg);
        }
        .frontClick {
          transform: rotateY(-180deg);
        }
        /* 卡片隐藏 */ 
        .cardHidden {
          transition: all 0.5s ease-in-out;
          transform: scale(0);
          transform-origin: center;
        }
      }
    }
  }

  // 游戏结束页
  .game_end {
    background: #f5c130;
    width: 100%;
    height: 487px;
    margin-left: 312px;
    z-index: 999;

    .score1 {
      position: relative;

      > img {
        width: 218px;
        margin: 108px 0 0 48px;
      }
      > span {
        display: inline-block;
        position: absolute;
        top: 62%;
        left: 40%;
        font-size: 55px;
        font-weight: bold;
      }
    }

    .clickBtn1 {
      padding-left: 39px;

      > img {
        width: 32px;
        margin: 30px 0 0 18px;
      }
    }
  }
  .moveShow1 {
    transform: translateX(-312px);
  }

  // 排行榜页
  .ranking {
    background: #f5c130;
    z-index: 9999;
    position: absolute;
    top: 0;
    left: -312px;

    .score2 {
      width: 312px;
      height: 487px;
      > img {
        width: 100%;
        height: 100%;
      }
    }

    .clickBtn2 {
      padding-left: 66px;
      margin-top: -102px;

      > img {
        width: 32px;
        margin: 30px 0 0 18px;
      }
    }
  }

  // 分享页
  .share {
    z-index: 9999;
    position: absolute;
    top: 0;
    left: -312px;

    .bgPic {
      width: 312px;
      height: 487px;
      > img {
        width: 100%;
        height: 100%;
      }
    }
  }
  .moveShow2 {
    left: 0;
  }
}
